from pyspark import SparkConf, SparkContext
import os
os.environ['PYSPARK_PYTHON'] = r"D://Python/Python3107/python.exe"

conf = SparkConf().setMaster("local[*]").setAppName("test_spark")
sc = SparkContext(conf=conf)

rdd = sc.parallelize(["itcast 666 jkjk", "suqingfeng 2023", "python gogogo"])
rdd2 = rdd.flatMap(lambda x: x.split(" "))
print(rdd2.collect())


sc.stop()